/*
 * HorizontalMovingStep.cpp
 *
 *  Created on: Dec 14, 2011
 *      Author: jianli
 */

#include "HorizontalMovingStep.h"


HorizontalMovingStep::~HorizontalMovingStep()
{
}

void HorizontalMovingStep::update(Uint32 ticks) {
	X(X() + (float)ticks * 0.001 * velocityX());
	if (X() <= getInitialPosition()[0] - 50 || X() > getInitialPosition()[0] + 50) {
		velocityX(-velocityX());
	}

}

void HorizontalMovingStep::draw() const
{
	Sprite::draw();
}





